package com.chenqi.model.dto;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * @description: 帖子添加请求
 * @program: ardaicommunity
 * @author: ChenQi
 * @create: 2021-03-2021/3/11-16-59
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = true)
public class PostDTO {

    /**
     * 标题
     */
    @NotBlank(message = "标题不能为空")
    @Length(min = 4,max = 25,message = "标题在4-25个字符之间")
    private String title;
    /**
     * 内容
     */
    @NotBlank(message = "内容不能为空")
    private String content;
    /**
     * 标签
     */
    @NotNull(message = "内容不能为空")
    private String[] tags;

    /**
     * 用户id
     */
    @NotNull(message = "用户id不能为空")
    private Integer userId;
}
